#ifndef PROJECT_H
#define PROJECT_H

#include <QSettings>
#include <QStringList>

namespace Plugins
{
    class RopeProject;
    class IRopeProject;
    class ProjectManagerPrivate;
    class Project: public QObject
    {
        Q_OBJECT
    friend class ProjectManagerPrivate;
    private:
        Project(const QString & projectPath);
        virtual ~Project();
    public:
        static Project * currentInstance();
        QString name();
        void setName(const QString& name);

        int pythonVersion();
        void setPythonVersion(int version);

        QString mainScript();
        void setMainScript(const QString& name);

        QString guiVersion();
        void setGuiVersion(const QString& version);

        QString path();
        QString filename();
        QString workspace();
        QStringList showFiles();
        void setShowFiles(const QStringList & files);

        IRopeProject *rope() const;
        QVariant lintConfig(const QString & name, const QVariant & defVal = "");
        bool setLintConfig(const QString & name, const QVariant & value);
        int pylintPreset(int defVal = 0);
        void setPylintPreset(int value);
        QString python();
        void save();

        QString lastSearch();
        QString lastSearchFilePattern();
        int searchFlags();

        void setLastSearch(const QString & search);
        void setLastSearchFilePattern(const QString & patt);
        void setSearchFlags(int flags);
    public:
        QStringList openedDirs();
        QStringList openedFiles();

        void openDir(const QString& dir);
        void closeDir(const QString& dir);

        void openFile(const QString& file);
        void closeFile(const QString& file);
    signals:
        void needReloadTree();
    private:
        void saveList(const QStringList& items, const QString& key, const QString& lkey);
        QSettings *_set;
        RopeProject *_rope;
    };
}
#endif // PROJECT_H
